<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字典管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#value").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					 var id=$("#id").val();
					 var beginDate=$("#startTime").val(); 
					 var endDate=$("#endTime").val(); 
					 var d1 = new Date(beginDate.replace(/\-/g, "\/")); 
					 var d2 = new Date(endDate.replace(/\-/g, "\/")); 
					 if(beginDate!=""&&endDate!=""&&d1 >d2) 
				     { 
						  alert("开始时间不能大于结束时间！"); 
						  return false; 
					 }
					 loading('正在提交，请稍等...');
				     form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/bfAct/getList/">活动列表</a></li>
		<li class="active"><a href="${ctx}/bfAct/form">活动${not empty actInfo.id?'修改':'添加'}</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="actInfo" action="${ctx}/bfAct/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="status"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">活动名称</label>
			<div class="controls">
				<form:input path="actName" htmlEscape="false" maxlength="30" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">简要描述</label>
			<div class="controls">
				<form:input path="actDes" htmlEscape="false" maxlength="200" class="" readonly="${actInfo.status==1?true:false }"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">活动类型</label>
			<div class="controls">
				<form:select path="actType" class="input-small required" disabled="${actInfo.status==1?true:false }">
					<form:options items="${fns:getDictList('act_info_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">考季年份</label>
			<div class="controls">
				<form:select path="examYear" class="input-small required" disabled="${actInfo.status==1?true:false }">
					<form:options items="${fns:getDictList('exam_year')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">活动考种</label>
			<div class="controls">
				<form:select path="examId" class="input-small required" disabled="${actInfo.status==1?true:false }">
					<form:options items="${fns:getDictList('mmsActivity')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">活动开始时间</label>
			<div class="controls">
				<input id="startTime" name="startTime" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate required"
				value="<fmt:formatDate value="${actInfo.startTime}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">活动结束时间</label>
			<div class="controls">
			<input id="endTime" name="endTime" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate required"
				value="<fmt:formatDate value="${actInfo.endTime}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">客服ID：</label>
			<div class="controls">
				 <form:input path="kfId" htmlEscape="false" maxlength="50" class=""/>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>